ci: Add MSVC build
authorXavier Claessens <xavier.claessens@collabora.com>
Thu, 29 Apr 2021 15:09:04 +0000 (11:09 -0400)
committerXavier Claessens <xavier.claessens@collabora.com>
Wed, 5 May 2021 13:16:36 +0000 (09:16 -0400)
This script is copied from glib CI.

.gitlab-ci.yml
.gitlab-ci/test-msvc.bat [new file with mode: 0644]

index 59dc2e6fec346994dba507e94515a781b8976d75..5ded2c02f2e704c1255b606f0466b1b29763f7f9 100644 (file)
@@ -172,6 +172,22 @@ macos:
     paths:
       - "${CI_PROJECT_DIR}/_build/meson-logs"
 
+vs2017-x64:
+  extends: .only-default
+  # TODO: Uncomment this when ready to merge.
+  #only:
+  #  - branches@GNOME/gtk
+  stage: build
+  tags:
+    - win32-ps
+  needs: []
+  script:
+    - .gitlab-ci/test-msvc.bat
+  artifacts:
+    when: always
+    paths:
+      - "${CI_PROJECT_DIR}/_build/meson-logs"
+
 .flatpak-defaults:
   image: $FLATPAK_IMAGE
   stage: flatpak
diff --git a/.gitlab-ci/test-msvc.bat b/.gitlab-ci/test-msvc.bat
new file mode 100644 (file)
index 0000000..294e948
--- /dev/null
@@ -0,0 +1,14 @@
+@echo on
+:: vcvarsall.bat sets various env vars like PATH, INCLUDE, LIB, LIBPATH for the
+:: specified build architecture
+call "C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\VC\Auxiliary\Build\vcvarsall.bat" x64
+@echo on
+
+:: FIXME: make warnings fatal
+pip3 install --upgrade --user meson==0.56.2  || goto :error
+meson _build || goto :error
+ninja -C _build || goto :error
+
+goto :EOF
+:error
+exit /b 1